def my_read_lines(f, new_line):
    buf = ""
    while True:
        while new_line in buf:
            pos = buf.index(new_line)
            yield buf[:pos]
            buf = buf[pos + len(new_line):]
        chunk = f.read(4096*10)
        if not chunk:
            yield buf
            break
        buf += chunk

if __name__ == '__main__':
    with open("test.txt") as file:
        for line in my_read_lines(file, "{|}"):
            print(line)